package com.xpffly.design.decorator.demo;

import com.xpffly.design.decorator.demo.service.SchoolReport;
import com.xpffly.design.decorator.demo.service.impl.FourthGradeSchoolReport;
import com.xpffly.design.decorator.demo.service.impl.HighScoreDecorator;
import com.xpffly.design.decorator.demo.service.impl.SortDecorator;

/**
 * @Author: xpengfei
 * @Date: 2021/4/8 23:14
 * @Description：
 */
public class Father {
    public static void main(String[] args) {
        // 拿到成绩单
        SchoolReport schoolReport;
        // 拿到原始的四年级成绩单
        schoolReport = new FourthGradeSchoolReport();
        // 为成绩单添加本次考试最高分的修饰
        schoolReport = new HighScoreDecorator(schoolReport);
        // 为成绩单添加本次考试排名的修饰
        schoolReport = new SortDecorator(schoolReport);
        // 给家长看成绩单
        schoolReport.report();
        // 家长签名
        schoolReport.sign();
    }
}
